﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using GameName1.Programming;

namespace GameName1
{
    public partial class ProgrammingPage : PhoneApplicationPage
    {
        public static string UserCode = @"
print('robot start');
function stop() {
    print('stopping robot');
    control.RightMotorSpeed=0;
    control.LeftMotorSpeed=0;
}

sleep(1000);
var i;
for(i=0; i<10; i++){
    print('sleeping: '+i);
    control.LeftMotorSpeed=i;
    sleep(1000);
}
stop();
";
        public ProgrammingPage()
        {
            InitializeComponent();
            CodeTextBox.Text = UserCode;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //Interpreter.Instance.Run(CodeTextBox.Text, ConsoleOutputTxt);
            UserCode = CodeTextBox.Text;
        }

    }
}